package container.set;

import java.util.Objects;

public class Student
{
    private String studentName;
    private int studentAge;
    
    public Student ()
    {
    
    }
    
    public Student (String studentName, int studentAge)
    {
        this.studentName = studentName;
        this.studentAge = studentAge;
    }
    
    @Override
    public String toString ()
    {
        return "Student{" +
               "studentName='" + studentName + '\'' +
               ", studentAge=" + studentAge +
               '}';
    }
    
    @Override
    public boolean equals (Object o)
    {
        if(this == o)
        {
            return true;
        }
        if(o == null || getClass() != o.getClass())
        {
            return false;
        }
        Student student = (Student) o;
        return studentAge == student.studentAge && Objects.equals(studentName, student.studentName);
    }
    
    @Override
    public int hashCode ()
    {
        return Objects.hash(studentName, studentAge);
    }
    
    public String getStudentName ()
    {
        return studentName;
    }
    
    public void setStudentName (String studentName)
    {
        this.studentName = studentName;
    }
    
    public int getStudentAge ()
    {
        return studentAge;
    }
    
    public void setStudentAge (int studentAge)
    {
        this.studentAge = studentAge;
    }
}
